#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

BIN_MANAGER=/usr/bin/prelude-manager
PID_MANAGER=/run/prelude-manager/prelude-manager.pid

depend() {
  need net
}

start() {
  ebegin "Starting prelude-manager"
  checkpath -d -m 0755 -o root:root /run/prelude-manager
  start-stop-daemon --start --exec $BIN_MANAGER \
    --pidfile $PID_MANAGER -- -d -P $PID_MANAGER
  eend $?
}

stop() {
  ebegin "Stopping prelude-manager"
  start-stop-daemon --stop --exec $BIN_MANAGER \
    --pidfile $PID_MANAGER
  eend $?
}
